package com.fans.springaop.test;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.PropertySource;

import com.fans.springaop.configure.LogServiceAspect;
import com.fans.springaop.dao.UserDao;
import com.fans.springaop.dao.impl.UserDaoImpl;
import com.fans.springaop.service.UserService;
import com.fans.springaop.service.impl.UserServiceImpl;


@Configuration
@ComponentScan({"com.fans.springaop" })
@EnableAspectJAutoProxy()
//@PropertySource("application.properties")
//@Import({LogServiceAspect.class})/*@Aspect可以生效,相当于Configuration类作用,都是配置类*/
public class FansBean {

	
	@Bean(name = "userDao")
	public UserDao userDao() {
		return new UserDaoImpl();
	}
	
	@Bean(name = "userService")
	public UserService userService() {
		return new UserServiceImpl();
	}
	
}
